﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VipSys.DataLayer;
using VipSys.SystemEntity;
using VipSys.Business;

namespace VipSys
{
    public partial class ViewInfoMag : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }
        private void BindData()
        {
            SysAccount sysAccount = Session["SysAccount"] as SysAccount;
            if (sysAccount == null)
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('登录超时，请重新登录!')</script>");
                return;
            }
            User user=new SystemEntity.User();
            user.ID=sysAccount.ID;
            UserAccess.Instance.GetUser(user, ref user);
            lblHotel.Text = user.Hotel;
            lblRoom.Text = user.Room;
            User roomie=null;
            roomie=Roomie.Instance.GetRoomie(sysAccount.ID,sysAccount.Room,sysAccount.Hotel);
            if(roomie!=null)
            {
                lblRoomie.Text = roomie.Name;
            }
        }
    }
}